Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid UninitializedPropertyAccessException for spreedCapabilities #4263

Conversation

mahibi
Copy link
Collaborator

@mahibi mahibi commented Sep 24, 2024

fix #4262

reported issue on gplay console was:

Exception kotlin.UninitializedPropertyAccessException: lateinit property spreedCapabilities has not been initialized
at com.nextcloud.talk.chat.ChatActivity.getSpreedCapabilities (ChatActivity.kt:284)
at com.nextcloud.talk.chat.ChatActivity.processExpiredMessages (ChatActivity.kt:2536)
at com.nextcloud.talk.chat.ChatActivity.access$processExpiredMessages (ChatActivity.kt:204)
at com.nextcloud.talk.chat.ChatActivity$initObservers$10$1.invokeSuspend (ChatActivity.kt:820)

This is just a hotfix while hoping processExpiredMessages is executed again while spreedCapabilities are available.

To improve the situation in the long term, we should move more logic to viewModel and have better control over sequence of actions.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

@mahibi mahibi added the 3. to review Waiting for reviews label Sep 24, 2024
@mahibi mahibi added this to the 20.0.2 milestone Sep 24, 2024
@mahibi mahibi self-assigned this Sep 24, 2024
@sowjanyakch sowjanyakch force-pushed the bugfix/4262/UninitializedPropertyAccessExceptionSpreedCapabilities branch from 034c8c9 to 96327ec Compare September 24, 2024 12:47
reported issue on gplay console was:

Exception kotlin.UninitializedPropertyAccessException: lateinit property spreedCapabilities has not been initialized
  at com.nextcloud.talk.chat.ChatActivity.getSpreedCapabilities (ChatActivity.kt:284)
  at com.nextcloud.talk.chat.ChatActivity.processExpiredMessages (ChatActivity.kt:2536)
  at com.nextcloud.talk.chat.ChatActivity.access$processExpiredMessages (ChatActivity.kt:204)
  at com.nextcloud.talk.chat.ChatActivity$initObservers$10$1.invokeSuspend (ChatActivity.kt:820)

This is just a hotfix while hoping processExpiredMessages is executed again while spreedCapabilities are available.

To improve the situation in the long term, we should move more logic to viewModel and have better control over sequence of actions.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@sowjanyakch sowjanyakch force-pushed the bugfix/4262/UninitializedPropertyAccessExceptionSpreedCapabilities branch from 96327ec to aeacfa0 Compare September 24, 2024 13:26
Copy link
Contributor

Codacy

Lint

TypemasterPR
Warnings8696
Errors131131

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1111
Dodgy code7979
Internationalization33
Malicious code vulnerability33
Performance66
Security11
Total109109

Lint increased!

Copy link
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/4263-talk.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud Talk app.

@sowjanyakch sowjanyakch merged commit 68627ad into master Sep 24, 2024
16 of 18 checks passed
@sowjanyakch sowjanyakch deleted the bugfix/4262/UninitializedPropertyAccessExceptionSpreedCapabilities branch September 24, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UninitializedPropertyAccessException for spreedCapabilities
2 participants